<template>
	<div style="width: 700px">
		<el-dialog :close-on-click-modal="false" :title="parameter.id ? ' 编辑' : '添加'" :visible.sync="show" v-if="show" width="85%"
		 v-loading="loading">
			<!-- 内容主体区 -->
			<el-form label-width="75px" ref="form" :model="request.data" :inline="true" :rules="rules">
				<el-row>
					<el-col :span="12">
						<el-form-item label="销售名称" prop="title">
							<el-input v-model="request.data.title" autocomplete="off"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="内部名称" prop="name">
							<el-input v-model="request.data.name" autocomplete="off"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="12">
						<el-form-item label="定价餐标" prop="price">
							<el-input v-model="request.data.price" autocomplete="off"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="10">
						<el-form-item label="专属公司" prop="ename">
							<el-select v-model="request.data.eid" placeholder="请选择">
								<el-option v-for="item in companys" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="24">
						<el-form-item label="备注" prop="remark">
							<el-input type="textarea" v-model="request.data.remark" autocomplete="off"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-form-item label="菜品描述" prop="description">
						<el-input type="textarea" v-model="request.data.description" autocomplete="off"></el-input>
					</el-form-item>
				</el-row>
				<el-row>
					<el-col :span="22">
						<el-form-item label="主菜">
							<el-card>
								<el-tag v-for="tag,index in ZCrightck" closable :disable-transitions="false" @close="ZChandleClose(tag)"
								 type="danger" effect="dark" style="margin: 0 5px;">
									{{tag.title}}
								</el-tag>
							</el-card>
						</el-form-item>
					</el-col>
					<el-col :span="2">
						<el-button @click="addZCBtn">添加</el-button>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="22">
						<el-form-item label="辅菜">
							<el-card>
								<el-tag v-for="tag,index in rightck" closable :disable-transitions="false" @close="handleClose(tag)"
								 effect="dark" type="warning" style="margin: 0 5px;">
									{{tag.title}}
								</el-tag>
							</el-card>
						</el-form-item>
					</el-col>
					<el-col :span="2">
						<el-button @click="addFCBtn">添加</el-button>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="22">
						<el-form-item label="青菜">
							<el-card>
								<el-tag v-for="tag,index in QCrightck" closable :disable-transitions="false" @close="QChandleClose(tag)"
								 type="success" effect="dark" style="margin: 0 5px;">
									{{tag.title}}
								</el-tag>
							</el-card>
						</el-form-item>
					</el-col>
					<el-col :span="2">
						<el-button @click="addQCBtn">添加</el-button>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="22">
						<el-form-item label="小食">
							<el-card>
								<el-tag v-for="tag,index in ZSrightck" closable :disable-transitions="false" @close="ZShandleClose(tag)"
								 type="info" effect="dark" style="margin: 0 5px;">
									{{tag.title}}
								</el-tag>
							</el-card>
						</el-form-item>
					</el-col>
					<el-col :span="2">
						<el-button @click="addZSBtn">添加</el-button>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="22">
						<el-form-item label="其他">
							<el-card>
								<el-tag v-for="tag,index in QTrightck" closable :disable-transitions="false" @close="QThandleClose(tag)"
								 type="danger" effect="dark" style="margin: 0 5px;">
									{{tag.title}}
								</el-tag>
							</el-card>
						</el-form-item>
					</el-col>
					<el-col :span="2">
						<el-button @click="addQTBtn">添加</el-button>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="6">
						<el-form-item label="状态">
							<el-select v-model="request.data.state" placeholder="请选择">
								<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
					<el-form-item label="是否辣" prop="isspicy">
						<el-col :span="18">
							<el-radio-group v-model="request.data.isspicy">
								<el-radio :label="1">辣</el-radio>
								<el-radio :label="2">不辣</el-radio>
							</el-radio-group>
						</el-col>
					</el-form-item>
				</el-row>

			</el-form>









			<!-- 添加对话框 -->
			<!-- 添加主菜 -->
			<el-dialog title="添加主菜" :visible.sync="ZCdialogtransVisible" width="800px" append-to-body>
				<el-transfer filterable :filter-method="ZCfilterMethod" filter-placeholder="请输入菜名" :titles="['待选主菜','已选主菜']"
				 v-model="ZCvalues" :data="ZCdata" @change="ZCchnageck">
				</el-transfer>
				<div slot="footer" class="dialog-footer">
					<el-button @click="addZCqx">取 消</el-button>
					<el-button type="primary" @click="addZC">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 添加对话框 -->
			<!-- 添加辅菜 -->
			<el-dialog title="添加辅菜" :visible.sync="dialogtransVisible" width="800px" append-to-body>
				<el-transfer filterable :filter-method="filterMethod" filter-placeholder="请输入菜名" :titles="['待选辅菜','已选辅菜']" v-model="values"
				 :data="FCdata" @change="chnageck">
				</el-transfer>
				<div slot="footer" class="dialog-footer">
					<el-button @click="addFCqx">取 消</el-button>
					<el-button type="primary" @click="addFC">确 定</el-button>
				</div>
			</el-dialog>
			<!-- 添加对话框 -->
			<!-- 添加青菜 -->
			<el-dialog title="添加青菜" :visible.sync="QCdialogtransVisible" width="800px" append-to-body>
				<el-transfer filterable :filter-method="QCfilterMethod" filter-placeholder="请输入菜名" :titles="['待选青菜','已选青菜']"
				 v-model="QCvalues" :data="QCdata" @change="QCchnageck">
				</el-transfer>
				<div slot="footer" class="dialog-footer">
					<el-button @click="addQCqx">取 消</el-button>
					<el-button type="primary" @click="addQC">确 定</el-button>
				</div>
			</el-dialog>

			<!-- 添加主食 -->
			<el-dialog title="添加主食" :visible.sync="ZSdialogtransVisible" width="800px" append-to-body>
				<el-transfer filterable :filter-method="ZSfilterMethod" filter-placeholder="请输入菜名" :titles="['待选主食','已选主食']"
				 v-model="ZSvalues" :data="ZSdata" @change="ZSchnageck">
				</el-transfer>
				<div slot="footer" class="dialog-footer">
					<el-button @click="addZSqx">取 消</el-button>
					<el-button type="primary" @click="addZS">确 定</el-button>
				</div>
			</el-dialog>

			<!-- 添加其他 -->
			<el-dialog title="添加其他" :visible.sync="QTdialogtransVisible" width="800px" height="60%" append-to-body>
				<el-transfer filterable :filter-method="QTfilterMethod" filter-placeholder="请输入菜名" :titles="['待选其他','已选其他']"
				 v-model="QTvalues" :data="QTdata" @change="QTchnageck">
				</el-transfer>
				<br>
				<el-form>
					<el-form-item label="其他定价">
						<el-input v-model="QTprice" autocomplete="off"></el-input>
					</el-form-item>
				</el-form>

				<div slot="footer" class="dialog-footer">
					<el-button @click="addQTqx">取 消</el-button>
					<el-button type="primary" @click="addQT">确 定</el-button>
				</div>
			</el-dialog>

			<div slot="footer" class="dialog-footer">
				<el-button type="primary" @click="submitForm('form')" v-hasPermission="parameter.id ? '00000055120001' : '0000005512000'">{{parameter.id?'确认修改':'确认添加'}}</el-button>
				<el-button @click="show = false">取 消</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import utils from 'util/utils.js';
	import constant from 'util/constant.js';
	import api from 'api/business/setmeal/setmeal.js';
	import editDialog from './edit.vue';
	import validate from 'util/validate.js';
	export default {
		name: 'edit',
		data() {

			return {
				// 辅菜数据
				FCdata: [],
				ZCdata: [],
				QCdata: [],
				ZSdata: [],
				QTdata: [],
				// 第一步
				ZCdishes: [],
				FCdishes: [],
				QCdishes: [],
				ZSdishes: [],
				QTdishes: [],
				loading: false,
				show: this.isDisplay,
				request: utils.newRequest(),
				companys: [],
				rules: {
					name: [{
							validator: validate.required,
							trigger: 'blur'
						},
						{
							validator: validate.length,
							min: 0,
							max: 50,
							trigger: 'blur'
						}
					],
					sno: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					title: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					isspicy: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					state: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					remark: [{
						validator: validate.length,
						max: 200,
						trigger: 'blur'
					}],
					price: [{
							validator: validate.required,
							trigger: 'blur'
						},
						{
							validator: validate.number,
							trigger: 'blur'
						}
					],
					QTprice: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					description: [{
						validator: validate.length,
						max: 200,
						trigger: 'blur'
					}],
					ZCrightck: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					rightck: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					QCrightck: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					ZSrightck: [{
						validator: validate.required,
						trigger: 'blur'
					}],
					QTrightck: [{
						validator: validate.required,
						trigger: 'blur'
					}]
				},
				// 状态
				options: [{
						label: '在用',
						value: 1
					},
					{
						label: '停用',
						value: 0
					}
				],
				// 下拉状态选中值
				value: '',
				// 辅菜对话框显示
				dialogtransVisible: false,
				Fdata: [],
				values: [],
				// 辅菜数据源
				rightck: [],
				filterMethod(query, item) {
					return item.pinyin.indexOf(query) > -1
				},
				// 主菜对话框显示
				ZCdialogtransVisible: false,
				ZCdata: [],
				ZCvalues: [],
				// 辅菜数据源
				ZCrightck: [],
				ZCfilterMethod(query, item) {
					return item.pinyin.indexOf(query) > -1
				},
				// 青菜对话框显示
				QCdialogtransVisible: false,
				QCdata: [],
				QCvalues: [],
				// 辅菜数据源
				QCrightck: [],
				QCfilterMethod(query, item) {
					return item.pinyin.indexOf(query) > -1
				},
				// 主食对话框显示
				ZSdialogtransVisible: false,
				ZSdata: [],
				ZSvalues: [],
				// 主食数据源
				ZSrightck: [],
				ZSfilterMethod(query, item) {
					return item.pinyin.indexOf(query) > -1
				},
				// 其他对话框显示
				QTdialogtransVisible: false,
				QTdata: [],
				QTvalues: [],
				// 其他数据源
				QTrightck: [],
				QTfilterMethod(query, item) {
					return item.pinyin.indexOf(query) > -1
				},
				content: null,
				editorOption: {},
				expression: [],
				QTprice: '',
				isfirst: true
			}
		},

		methods: {
			addZCBtn() {
				const cities = []
				api.ZClist(this.request, response => {
					this.ZCdishes = []
					this.ZCdishes = response.data.records
					if (this.parameter.id) {
						for (var i = 0; i < response.data.records.length; i++) {
							for (var j = 0; j < this.ZCrightck.length; j++) {
								if (this.ZCrightck[j].title == response.data.records[i].title) {
									this.ZCvalues.push(i)
									console.log(i)
								}
							}

							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})

						}
					} else {

						for (var i = 0; i < response.data.records.length; i++) {
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
						console.log(cities)
					}
				})

				this.ZCdata = cities
				this.ZCdialogtransVisible = true
			},
			// 主菜标签关闭
			ZChandleClose(tag) {
				this.ZCrightck.splice(this.ZCrightck.indexOf(tag), 1)
				this.ZCvalues.splice(this.ZCvalues.indexOf(tag), 1)
				console.log(this.ZCrightck)
			},
			// 主菜穿梭框右列表的值
			ZCchnageck(data, index) {
				this.ZCrightck = []
				let a = new Set()
				for (var i = 0; i < data.length; i++) {
					var element = this.ZCdishes[this.ZCdata[data[i]].key]
					a.add(element);
				}
				//this.ZCrightck.push(element)
				this.ZCrightck = [...a]
				console.log(this.ZCrightck)//...........
				// // console.log(data)
			},
			// 主菜确认添加
			addZC() {
				this.ZCdialogtransVisible = false
			},
			// 主菜取消添加
			addZCqx() {
				if (this.parameter.id) {
					this.ZCdialogtransVisible = false
				} else {
					this.QTprice = ''
					this.ZCrightck = []
					this.ZCvalues = []
					this.ZCdialogtransVisible = false
				}
			},
			// 辅菜标签关闭
			handleClose(tag) {
				this.rightck.splice(this.rightck.indexOf(tag), 1)
				this.values.splice(this.values.indexOf(tag), 1)
				console.log(this.rightck)
			},
			// 辅菜穿梭框右列表的值
			chnageck(data, index) {
				this.rightck = []
				let a = new Set()
				for (var i = 0; i < data.length; i++) {
					var element = this.FCdishes[this.FCdata[data[i]].key]
					a.add(element);
				}
				this.rightck = [...a]
				// this.rightck.push(element)
			},
			addFCBtn() {
				const cities = []
				api.FClist(this.request, response => {
					this.FCdishes = []
					this.FCdishes = response.data.records
					if (this.parameter.id) {
						for (var i = 0; i < response.data.records.length; i++) {
							for (var j = 0; j < this.rightck.length; j++) {
								if (this.rightck[j].title == response.data.records[i].title) {
									this.values.push(i)
								}
							}
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})

						}
					} else {

						for (var i = 0; i < response.data.records.length; i++) {

							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
						console.log(cities)
					}
				})
				this.FCdata = cities
				console.log(this.FCdata)
				this.dialogtransVisible = true
			},
			// 辅菜确认添加
			addFC() {
				this.dialogtransVisible = false
			},
			// 辅菜取消添加
			addFCqx() {
				if (this.parameter.id) {
					this.dialogtransVisible = false
				} else {
					this.QTprice = ''
					this.rightck = []
					this.values = []
					this.dialogtransVisible = false
				}
			},
			// 青菜标签关闭
			QChandleClose(tag) {
				this.QCrightck.splice(this.QCrightck.indexOf(tag), 1)
				this.QCvalues.splice(this.QCvalues.indexOf(tag), 1)
				console.log(this.QCrightck)
			},
			// 青菜穿梭框右列表的值
			QCchnageck(data, index) {
				this.QCrightck = []
				let a = new Set()
				for (var i = 0; i < data.length; i++) {
					var element = this.QCdishes[this.QCdata[data[i]].key]
					a.add(element);
					// this.QCrightck.push(element)
				}
				console.log(this.QCrightck)
				this.QCrightck = [...a]
				// console.log(data)
			},

			addQCBtn() {
				const cities = []
				api.QClist(this.request, response => {
					this.QCdishes = []
					this.QCdishes = response.data.records
					if (this.parameter.id) {
						for (var i = 0; i < response.data.records.length; i++) {
							for (var j = 0; j < this.QCrightck.length; j++) {
								if (this.QCrightck[j].title == response.data.records[i].title) {
									this.QCvalues.push(i)
								}
							}
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})

						}
					} else {

						for (var i = 0; i < response.data.records.length; i++) {
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
						console.log(cities)
					}
				})

				this.QCdata = cities
				this.QCdialogtransVisible = true
			},
			// 青菜确认添加
			addQC() {
				this.QCdialogtransVisible = false
			},
			// 青菜取消添加
			addQCqx() {
				if (this.parameter.id) {
					this.QCdialogtransVisible = false
				} else {
					this.QTprice = ''
					this.QCrightck = []
					this.QCvalues = []
					this.QCdialogtransVisible = false
				}
			},
			// 主食标签关闭
			ZShandleClose(tag) {
				this.ZSrightck.splice(this.ZSrightck.indexOf(tag), 1)
				this.ZSvalues.splice(this.ZSvalues.indexOf(tag), 1)
				console.log(this.ZSrightck)
			},
			// 主食穿梭框右列表的值
			ZSchnageck(data, index) {
				this.ZSrightck = []
				let a = new Set()
				for (var i = 0; i < data.length; i++) {
					var element = this.ZSdishes[this.ZSdata[data[i]].key]
					a.add(element);
					// this.ZSrightck.push(element)
				}
				this.ZSrightck = [...a]
				console.log(this.ZSrightck)
			},

			addZSBtn() {
				const cities = []
				api.ZSlist(this.request, response => {
					this.ZSdishes = []
					this.ZSdishes = response.data.records
					if (this.parameter.id) {
						for (var i = 0; i < response.data.records.length; i++) {
							for (var j = 0; j < this.ZSrightck.length; j++) {
								if (this.ZSrightck[j].title == response.data.records[i].title) {
									this.ZSvalues.push(i)
								}
							}
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})

						}
					} else {

						for (var i = 0; i < response.data.records.length; i++) {
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
						console.log(cities)
					}
				})

				this.ZSdata = cities
				this.ZSdialogtransVisible = true
			},
			// 主食确认添加
			addZS() {
				this.ZSdialogtransVisible = false
			},
			// 主食取消添加
			addZSqx() {
				if (this.parameter.id) {

				} else {
					this.QTprice = ''
					this.ZSrightck = []
					this.ZSvalues = []
				}
				this.ZSdialogtransVisible = false
			},



			// 其他标签关闭
			QThandleClose(tag) {
				this.QTrightck.splice(this.QTrightck.indexOf(tag), 1)
				this.QTvalues.splice(this.QTvalues.indexOf(tag), 1)
				this.QTprice = ''
				console.log(this.QTrightck)
			},
			// 其他穿梭框右列表的值
			QTchnageck(data, index) {
				this.QTrightck = []
				let a = new Set()
				for (var i = 0; i < data.length; i++) {
					var element = this.QTdishes[this.QTdata[data[i]].key]
					a.add(element);
					// this.QTrightck.push(element)
				}
				this.QTrightck = [...a]
				console.log(this.QTrightck)
			},

			addQTBtn() {
				const cities = []

				api.QTlist(this.request, response => {
					this.QTCdishes = []
					this.QTdishes = response.data.records
					if (this.parameter.id) {
						for (var i = 0; i < response.data.records.length; i++) {
							for (var j = 0; j < this.QTrightck.length; j++) {
								if (this.QTrightck[j].title == response.data.records[i].title) {
									this.QTvalues.push(i)
								}
							}
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
					} else {
						this.QTprice = ''
						for (var i = 0; i < response.data.records.length; i++) {
							cities.push({
								label: response.data.records[i].title,
								key: i,
								pinyin: response.data.records[i].title
							})
						}
						console.log(cities)
					}
				})

				this.QTdata = cities
				this.QTdialogtransVisible = true
			},
			// 其他确认添加
			addQT() {
				const price = this.QTprice.split(',');
				if (this.QTrightck != null && this.QTprice != null) {
					for (var i = 0; i < this.QTrightck.length; i++) {
						if(price[i]!=''&&price[i]!=undefined){
							this.QTrightck[i].title = this.QTrightck[i].title + ' ' + price[i] + '.00￥';
						}else{
							this.QTrightck[i].title = this.QTrightck[i].title+ ' '+ '0.00￥';
						}
						
					}
				}
				this.QTdialogtransVisible = false
			},
			// 其他取消添加
			addQTqx() {
				if (this.parameter.id) {
				} else {
					this.QTprice = ''
					this.QTrightck = []
					this.QTvalues = []
				}
				this.QTdialogtransVisible = false
			},
			onEditorBlur() {},
			// 获得焦点事件
			onEditorFocus() {},
			// 内容改变事件
			onEditorChange() {},
			//提交表单
			submitForm(formName) {
				utils.checkForm(this.$refs[formName], () => {

					this.loading = true;
					if (this.parameter.id) {
						this.expression = []
						this.expression.push({
							id: '01',
							key: '主菜',
							contents: this.ZCrightck
						})
						this.expression.push({
							id: '02',
							key: '副菜',
							contents: this.rightck
						})
						this.expression.push({
							id: '03',
							key: '青菜',
							contents: this.QCrightck
						})
						this.expression.push({
							id: '04',
							key: '小食',
							contents: this.ZSrightck
						})
						this.expression.push({
							id: '05',
							key: '其他',
							contents: this.QTrightck
						})
						this.request.data.expression = JSON.stringify(this.expression)
						//编辑
						api.update(
							this.request,
							response => {
								utils.msg.success(response.msg);
								this.loading = false;
								this.show = false;
								this.$parent.list(this.$parent.request);
							},
							response => {
								utils.msg.warning(response.msg);
								this.loading = false;
							}
						);
					} else {
						this.expression=[]
						this.expression.push({
							id: '01',
							key: '主菜',
							contents: this.ZCrightck
						})
						this.expression.push({
							id: '02',
							key: '副菜',
							contents: this.rightck
						})
						this.expression.push({
							id: '03',
							key: '青菜',
							contents: this.QCrightck
						})
						this.expression.push({
							id: '04',
							key: '小食',
							contents: this.ZSrightck
						})
						this.expression.push({
							id: '05',
							key: '其他',
							contents: this.QTrightck
						})
						this.request.data.expression = JSON.stringify(this.expression)

						//添加
						api.save(
							this.request,
							response => {
								utils.msg.success(response.msg);
								this.loading = false;
								this.show = false;
								this.$parent.list(this.$parent.request);
							},
							response => {
								utils.msg.warning(response.msg);
								this.loading = false;
							}
						);
					}
				});
			},
			init() {

				this.request = utils.newRequest();
				this.companys = []
				// 查询公司
				api.getcompanys(this.request, response => {
					for (let index = 0; index < response.data.length; index++) {
						this.companys.push({
							label: response.data[index].ename,
							value: response.data[index].id
						})
					}

					console.log(this.companys)
				})

				if (this.parameter.id) {
					this.ZCrightck = []
					this.rightck = []
					this.QCrightck = []
					this.ZSrightck = []
					this.QTrightck = []
					//编辑
					this.request.param.id = this.parameter.id;
					api.toUpdate(this.request, response => {
						this.request.data = response.data;
						this.request.data.expression = eval('(' + response.data.expression + ')')


						for (let index = 0; index < this.request.data.expression.length; index++) {
							if (this.request.data.expression[index].key == '主菜') {
								for (var i = 0; i < this.request.data.expression[index].contents.length; i++) {
									this.ZCrightck.push(this.request.data.expression[index].contents[i])
								}
							}
							if (this.request.data.expression[index].key == '副菜') {
								for (var i = 0; i < this.request.data.expression[index].contents.length; i++) {
									this.rightck.push(this.request.data.expression[index].contents[i])
								}
							}
							if (this.request.data.expression[index].key == '青菜') {
								for (var i = 0; i < this.request.data.expression[index].contents.length; i++) {
									this.QCrightck.push(this.request.data.expression[index].contents[i])
								}
							}
							if (this.request.data.expression[index].key == '小食') {
								this.request.data.expression[index].contents.forEach((element, indx) => {
									this.ZSrightck.push(element)
								});
							}
							if (this.request.data.expression[index].key == '其他') {
								this.request.data.expression[index].contents.forEach((element, indx) => {
									this.QTrightck.push(element)
								});
							}
						}
					});
				} else {
					//添加
					this.ZCrightck = []
					this.rightck = []
					this.QCrightck = []
					this.ZSrightck = []
					this.QTrightck = []
					this.ZCvalues = []
					this.values = []
					this.QCvalues = []
					this.ZSvalues = []
					this.QTvalues = []
					this.ZCdishes=[]
					this.FCdishes=[]
					this.QCdishes=[]
					this.ZSdishes=[]
					this.QTCdishes=[]
				}
			}
		},
		props: {
			isDisplay: {
				type: Boolean,
				default () {
					return false;
				}
			},
			parameter: {
				type: Array | Object,
				default () {
					return {};
				}
			}
		},
		watch: {
			isDisplay(val) {
				this.show = val;
				if (val) {
					this.init();
				}
			},
			show(val) {
				this.$emit('update:isDisplay', val);
			},
			parameter(val) {
				this.parameter = val;
			}
		}
	}
</script>

<style lang="scss">
	@import '~common/custom/css/common.scss';

	html,
	body,
	#app {
		padding: 0;
		margin: 0;
		height: 100%;
		width: 100%;
	}

	.el-card {
		box-shadow: 0 1px rgba(0, 0, 0, 0.15);
	}

	.el-transfer-panel__item.el-checkbox {
		text-align: left;
	}

	.el-transfer-panel .el-transfer-panel__header .el-checkbox {
		text-align: left;
	}

	.el-transfer {
		font-size: 14px;
		text-align: left;
	}
</style>
